package com.bsoft.gol.hcb.dao.evaluation;

import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import ctd.persistence.support.hibernate.HibernateSupportDelegateDAO;
import ctd.spring.boot.annotation.SsdevDao;
import ctd.util.annotation.RpcService;
import hcn.base.evaluation.EvaluationDefine;

/**
 * Created by mlm on 2015/11/30.
 *
 * 满意度评价定义
 */
@SsdevDao(serviceId = "evaluationDefineDAOService")
public abstract class EvaluationDefineDAO extends HibernateSupportDelegateDAO<EvaluationDefine> {

    public EvaluationDefineDAO() {
        this.setKeyField("id");
    }

    /**
     * 通过业务类型查询满意度评价定义
     *
     * @param businessType
     * @return
     */
    @DAOMethod(sql = "from EvaluationDefine a where a.businessType=:businessType and a.occasion=:occasion")
    public abstract EvaluationDefine getByBusinessType(@DAOParam("businessType") String businessType,@DAOParam("occasion") String occasion);

    @RpcService
    public EvaluationDefine saveEvaluationDefine(final EvaluationDefine evaluationDefine){
        return this.save(evaluationDefine);
    }

}
